<!DOCTYPE HTML>
<html>
	<head>
		<meta http-equiv="Content-Type" content="html/html; charset=utf-8" />
		<title>CCAppDelegate Class Reference</title>
		<meta id="xcode-display" name="xcode-display" content="render"/>
		<link rel="stylesheet" type="text/css" href="../css/styles.css" media="all" />
		<link rel="stylesheet" type="text/css" media="print" href="../css/stylesPrint.css" />
		<meta name="generator" content="appledoc 2.2 (build 963)" />
	</head>
	<body>
		<header id="top_header">
			<div id="library" class="hideInXcode">
				<h1><a id="libraryTitle" href="../index.html">Cocos2D </a></h1>
				<a id="developerHome" href="../index.html">3.2.0</a>
			</div>
			
			<div id="title" role="banner">
				<h1 class="hideInXcode">CCAppDelegate Class Reference</h1>
			</div>
			<ul id="headerButtons" role="toolbar">
				<li id="toc_button">
					<button aria-label="Show Table of Contents" role="checkbox" class="open" id="table_of_contents"><span class="disclosure"></span>Table of Contents</button>
				</li>
				<li id="jumpto_button" role="navigation">
					<select id="jumpTo">
	<option value="top">Jump To&#133;</option>
	
	<option value="overview">Overview</option>
	
	
	
	
	<option value="tasks">Tasks</option>
	
	
	
	
	
	<option value="properties">Properties</option>
	
	<option value="//api/name/navController">&nbsp;&nbsp;&nbsp;&nbsp;navController</option>
	
	<option value="//api/name/window">&nbsp;&nbsp;&nbsp;&nbsp;window</option>
	
	
	
	
	
	
	<option value="instance_methods">Instance Methods</option>
	
	<option value="//api/name/setupCocos2dWithOptions:">&nbsp;&nbsp;&nbsp;&nbsp;- setupCocos2dWithOptions:</option>
	
	<option value="//api/name/startScene">&nbsp;&nbsp;&nbsp;&nbsp;- startScene</option>
	
	
	
</select>
				</li>
			</ul>
		</header>
		<nav id="tocContainer" class="isShowingTOC">
			<ul id="toc" role="tree">
				
<li role="treeitem"><span class="nodisclosure"></span><span class="sectionName"><a href="#overview">Overview</a></span></li>




<li role="treeitem" id="task_treeitem"><span class="nodisclosure"></span><span class="sectionName"><a href="#tasks">Tasks</a></span><ul>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#task_Accessing Window and Navigation Controller">Accessing Window and Navigation Controller</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#task_Setting Up the Start Scene">Setting Up the Start Scene</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#task_Cocos2d Configuration">Cocos2d Configuration</a></span></li>
	
</ul></li>





<li role="treeitem" class="children"><span class="disclosure"></span><span class="sectionName"><a href="#properties">Properties</a></span><ul>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/navController">navController</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/window">window</a></span></li>
	
</ul></li>





<li role="treeitem" class="children"><span class="disclosure"></span><span class="sectionName"><a href="#instance_methods">Instance Methods</a></span><ul>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/setupCocos2dWithOptions:">setupCocos2dWithOptions:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/startScene">startScene</a></span></li>
	
</ul></li>


			</ul>
		</nav>
		<article>
			<div id="contents" class="isShowingTOC" role="main">
				<a title="CCAppDelegate Class Reference" name="top"></a>
				<div class="main-navigation navigation-top">
					<ul>
	<li><a href="../index.html">Index</a></li>
	<li><a href="../hierarchy.html">Hierarchy</a></li>
</ul>
				</div>
				<div id="header">
					<div class="section-header">
						<h1 class="title title-header">CCAppDelegate Class Reference</h1>
					</div>		
				</div>
				<div id="container">	
					
					<div class="section section-specification"><table cellspacing="0"><tbody>
						<tr>
	<td class="specification-title">Inherits from</td>
	<td class="specification-value">NSObject</td>
</tr><tr>
	<td class="specification-title">Conforms to</td>
	<td class="specification-value">CCDirectorDelegate<br />UIApplicationDelegate</td>
</tr><tr>
	<td class="specification-title">Declared in</td>
	<td class="specification-value">CCAppDelegate.h</td>
</tr>
						</tbody></table></div>
					
                    
                    
					
					<div class="section section-overview">
						<a title="Overview" name="overview"></a>
						<h2 class="subtitle subtitle-overview">Overview</h2>
						<p>Most Cocos2d apps should override the CCAppDelegate, it serves as the apps starting point. By the very least, the <a href="#//api/name/startScene">startScene</a> method should be overridden to return the first scene the app should display. To further customize the behavior of Cocos2d, such as the screen mode of pixel format, override the applicaton:didFinishLaunchingWithOptions: method.</p>
					</div>
					
					
					
					
					
					<div class="section section-tasks">
						<a title="Tasks" name="tasks"></a>
						<h2 class="subtitle subtitle-tasks">Tasks</h2>
						
						
						<a title="Accessing Window and Navigation Controller" name="task_Accessing Window and Navigation Controller"></a>
						<h3 class="subsubtitle task-title">Accessing Window and Navigation Controller</h3>

						<ul class="task-list">
							<li>
	<span class="tooltip">
		<code><a href="#//api/name/window">&nbsp;&nbsp;window</a></code>
	</span>
	<span class="task-item-suffix">property</span>
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/navController">&nbsp;&nbsp;navController</a></code>
	</span>
	<span class="task-item-suffix">property</span>
	
</li>
						</ul>
						
						
						<a title="Setting Up the Start Scene" name="task_Setting Up the Start Scene"></a>
						<h3 class="subsubtitle task-title">Setting Up the Start Scene</h3>

						<ul class="task-list">
							<li>
	<span class="tooltip">
		<code><a href="#//api/name/startScene">&ndash;&nbsp;startScene</a></code>
	</span>
	
	
</li>
						</ul>
						
						
						<a title="Cocos2d Configuration" name="task_Cocos2d Configuration"></a>
						<h3 class="subsubtitle task-title">Cocos2d Configuration</h3>

						<ul class="task-list">
							<li>
	<span class="tooltip">
		<code><a href="#//api/name/setupCocos2dWithOptions:">&ndash;&nbsp;setupCocos2dWithOptions:</a></code>
	</span>
	
	
</li>
						</ul>
						
					</div>
					
					
					
					
					
					<div class="section section-methods">
						<a title="Properties" name="properties"></a>
						<h2 class="subtitle subtitle-methods">Properties</h2>
						
						<div class="section-method">
	<a name="//api/name/navController" title="navController"></a>
	<h3 class="subsubtitle method-title">navController</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>The navigation controller that Cocos2d is using.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>@property (atomic, readonly) CCNavigationController *navController</code></div>

    
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">CCAppDelegate.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/window" title="window"></a>
	<h3 class="subsubtitle method-title">window</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>The window used to display the Cocos2d content.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>@property (nonatomic, strong) UIWindow *window</code></div>

    
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">CCAppDelegate.h</code><br />
	</div>				
	
	
</div>
						
					</div>
					
					
					
					
					
					<div class="section section-methods">
						<a title="Instance Methods" name="instance_methods"></a>
						<h2 class="subtitle subtitle-methods">Instance Methods</h2>
						
						<div class="section-method">
	<a name="//api/name/setupCocos2dWithOptions:" title="setupCocos2dWithOptions:"></a>
	<h3 class="subsubtitle method-title">setupCocos2dWithOptions:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>This method is normally called from the applicaton:didFinishLaunchingWithOptions: method. It will configure Cocos2d with the options that you provide. You can leave out any of the options and Cocos2d will use the default values.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (void)setupCocos2dWithOptions:(NSDictionary *)<em>config</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>config</em></dt>
			<dd><p>Dictionary with options for configuring Cocos2d.</p></dd>
		</dl>
		
	</div>
	
	
	
	
	
	
	
	<div class="method-subsection discussion-section">
		<h4 class="method-subtitle">Discussion</h4>
		<p>Currently supported keys for the configuration dictionary are:</p>

<ul>
<li>CCSetupPixelFormat NSString with the pixel format, normally kEAGLColorFormatRGBA8 or kEAGLColorFormatRGB565. The RGB565 option is faster, but will allow less colors.</li>
<li>CCSetupScreenMode NSString value that accepts either CCScreenModeFlexible or CCScreenModeFixed.</li>
<li>CCSetupScreenOrientation NSString value that accepts CCScreenOrientationLandscape, CCScreenOrientationPortrait, or CCScreenOrientationAll.</li>
<li>CCSetupAnimationInterval NSNumber with double. Specifies the desired interval between animation frames. Supported values are 1.0/60.0 (default) and 1.0/30.0.</li>
<li>CCSetupFixedUpdateInterval NSNumber with double. Specifies the desired interval between fixed updates.Should be smaller than CCSetupAnimationInterval. Defaults to 1/60.0.</li>
<li>CCSetupShowDebugStats NSNumber with bool. Specifies if the stats (FPS, frame time and draw call count) should be shown. Defaults to NO.</li>
<li><p>CCSetupTabletScale2X NSNumber with bool. If true, the iPad will be setup to act like it has a 512x384 &ldquo;retina&rdquo; screen. This makes it much easier to make universal iOS games. This value is ignored when using the fixed screen mode.</p></li>
<li><p>CCSetupDepthFormat NSNumber with integer. Specifies the desired depth format. Values are 0, GL_DEPTH_COMPONENT24_OES and GL_DEPTH24_STENCIL8_OES.</p></li>
<li>CCSetupPreserveBackbuffer NSNumber with bool. Specifies whether backbuffer will be preserved.</li>
<li>CCSetupMultiSampling NSNumber with bool. Specifies whether miltisampling is enabled.</li>
<li>CCSetupNumberOfSamples NSNumber with integer. Specifies number of samples when multisampling is enabled.</li>
</ul>

	</div>
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">CCAppDelegate.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/startScene" title="startScene"></a>
	<h3 class="subsubtitle method-title">startScene</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Override this method to return the first scene that Cocos2d should display.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (CCScene *)startScene</code></div>

    
	
	
	
	<div class="method-subsection return">
		<h4 class="method-subtitle parameter-title">Return Value</h4>
		<p>Starting scene for your app.</p>
	</div>
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">CCAppDelegate.h</code><br />
	</div>				
	
	
</div>
						
					</div>
					
					
                    
                    
				</div>
				<div class="main-navigation navigation-bottom">
					<ul>
	<li><a href="../index.html">Index</a></li>
	<li><a href="../hierarchy.html">Hierarchy</a></li>
</ul>
				</div>
				<div id="footer">
					<hr />
					<div class="footer-copyright">
						<p><span class="copyright">&copy; 2014 3.2.0. All rights reserved. (Last updated: 2014-08-12)</span><br />
						
						<span class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2 (build 963)</a>.</span></p>
						
					</div>
				</div>
			</div>
		</article>
		<script type="text/javascript">
			function jumpToChange()
			{
				window.location.hash = this.options[this.selectedIndex].value;
			}
			
			function toggleTOC()
			{
				var contents = document.getElementById('contents');
				var tocContainer = document.getElementById('tocContainer');
				
				if (this.getAttribute('class') == 'open')
				{
					this.setAttribute('class', '');
					contents.setAttribute('class', '');
					tocContainer.setAttribute('class', '');
					
					window.name = "hideTOC";
				}
				else
				{
					this.setAttribute('class', 'open');
					contents.setAttribute('class', 'isShowingTOC');
					tocContainer.setAttribute('class', 'isShowingTOC');
					
					window.name = "";
				}
				return false;
			}
			
			function toggleTOCEntryChildren(e)
			{
				e.stopPropagation();
				var currentClass = this.getAttribute('class');
				if (currentClass == 'children') {
					this.setAttribute('class', 'children open');
				}
				else if (currentClass == 'children open') {
					this.setAttribute('class', 'children');
				}
				return false;
			}
			
			function tocEntryClick(e)
			{
				e.stopPropagation();
				return true;
			}
			
			function init()
			{
				var selectElement = document.getElementById('jumpTo');
				selectElement.addEventListener('change', jumpToChange, false);
				
				var tocButton = document.getElementById('table_of_contents');
				tocButton.addEventListener('click', toggleTOC, false);
				
				var taskTreeItem = document.getElementById('task_treeitem');
				if (taskTreeItem.getElementsByTagName('li').length > 0)
				{
					taskTreeItem.setAttribute('class', 'children');
					taskTreeItem.firstChild.setAttribute('class', 'disclosure');
				}
				
				var tocList = document.getElementById('toc');
				
				var tocEntries = tocList.getElementsByTagName('li');
				for (var i = 0; i < tocEntries.length; i++) {
					tocEntries[i].addEventListener('click', toggleTOCEntryChildren, false);
				}
				
				var tocLinks = tocList.getElementsByTagName('a');
				for (var i = 0; i < tocLinks.length; i++) {
					tocLinks[i].addEventListener('click', tocEntryClick, false);
				}
				
				if (window.name == "hideTOC") {
					toggleTOC.call(tocButton);
				}
			}
			
			window.onload = init;
			
			// If showing in Xcode, hide the TOC and Header
			if (navigator.userAgent.match(/xcode/i)) {
				document.getElementById("contents").className = "hideInXcode"
				document.getElementById("tocContainer").className = "hideInXcode"
				document.getElementById("top_header").className = "hideInXcode"
			}
			
		</script>
	</body>
</html>